﻿using Manson.AuthorizationHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;

using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Manson.AuthorzationAssistant
{
    public partial class FrmAuthorzationAssistant : Form
    {
        public FrmAuthorzationAssistant()
        {
            InitializeComponent();
        }

        private void btn_Create_Click(object sender, EventArgs e)
        {
            if(this.txt_MachineCode.Text.Length==0)
            {
                MessageBox.Show("请输入机器码！","软件授权");
                return;
            }
            string info= Authorization.Encrypt(Authorization.GetMD5String(this.txt_MachineCode.Text));

            Clipboard.SetDataObject(info);

            this.txt_AuthorzationCode.Text = info;
            MessageBox.Show("授权码已生成并复制:"+info, "软件授权");
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.Close();   
        }
    }
}
